package Java测试.编码7;

import java.util.ArrayList;

//7：第一三维不平衡数组如下：int a[][] []= {{{1,2},{3,4,5}},{{6,7},{8,9,10,11}}};
//编程实现输出数组a各个元素，并求各元素之和。
public class Test {
    public static void main(String[] args) {
        int a[][] []= {{{1,2},{3,4,5}},{{6,7},{8,9,10,11}}};
        int sum=0;
        for (int[][] ints : a) {
            for (int[] anInt : ints) {
                for (int i : anInt) {
                    System.out.print(i+" ");
                    sum+=i;
                }
            }
        }
        System.out.println(sum);
    }
}
